package lianxi3;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class Person {
    private String name;

    public Person(){
        System.out.println("1");

    }
    public String getName() {
        return name;
    }
    @Value("大人")
    public void setName(String name) {
        this.name = name;
        System.out.println("2");
    }
    @PostConstruct
    public void init(){
        System.out.println("3");
    }
    @PreDestroy
    public void destroy(){
        System.out.println("4");
    }
}
